package com.example.mydemo.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.event.TransactionalEventListener;
import org.springframework.util.Assert;

public class redisUtill {
    @Autowired
    private RedisTemplate redisTemplate;

    @TransactionalEventListener
    public void test() throws Exception{
                 //保存字符串
        String ss=  (String) redisTemplate.opsForValue().get("getViews:id=1565type=1");
        System.out.println(ss);
    }
}
